﻿<?php if(!defined('BASEPATH'))exit('No direct script access allowed');
class trangchu extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->library('addin');
		$this->load->library('files');
	}
	//get ho tro truc tuyen
	//get san pham noi bat
	//get noi that gia dinh
	//get chungloai <=> loaiphong <=> loai
	//get sanpham moi
	public function index()
	{
		$this->load->model('hotro_model');
		$data1['hotro'] = $this->hotro_model->get();
		$this->load->model('sanpham_model');
		$data1['noibat'] = $this->sanpham_model->getNoiBat();
		$data2['sanpham'] = $this->sanpham_model->getSPTrangChu();
		$data1['counter'] = $this->addin->getcounter();
		$data1['online'] = $this->addin->getonline();
		$menu1 = $this->addin->getMenuMain();
		$data1['menu1'] = $menu1;
		$data3['menu1'] = $menu1;
		$data1['menu2'] = $this->addin->getMenu3Cap();
		$data1['thongke'] = $this->addin->thongKe();
		$data1['imgSlide'] = $this->files->readfileinfolder('image/slide/');
		$this->load->view('required/header-trangchu',$data1);
		$this->load->view('trangchu/index',$data2);
		$this->load->view('required/footer',$data3);
		//$this->output->enable_profiler(TRUE);
		//counter : int : So nguoi da truy cap
		//online : int : So nguoi dang online
		//$hotro [] -> ten, phone
		//$noibat [] -> ten, tenUrl, hinh1 (tenUrl: base_url('sanpham/chitietsanpham/'.$item->tenUrl.'html'))
		//$menu1 : string (Chỉnh sửa lại chuỗi xuất ra)
		//$menu2 : string (Chỉnh sửa lại chuỗi xuất ra)
		//$sanpham [] -> ten, tenUrl, hinh1, noidung, gia
	}
}